package com.example.mqdemo.PointToPoint.annotationType;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/*
 *@description: 点对点队列消息接收者注解版
 *@author: hisen
 *@Time: 2023/11/20  22:59
 */
@Component
public class PointToPointConsumer {

    @RabbitListener(queues = "point_to_point",containerFactory = "pointToPointFactory")
    public void handleMessage(String message) {
        // 处理收到的消息
        System.out.println("收到消息: " + message);
    }
}
